var Items=new Array();
function add(id,iArray) 
{ 
    Items[id] = iArray;
} 
add(0,["1:北京","2:天津","3:上海","4:重庆","5:河北","6:山西","7:台湾","8:辽宁","9:吉林","10:黑龙江","11:江苏","12:浙江","13:安徽","14:福建","15:江西","16:山东","17:河南","18:湖北","19:湖南","20:广东","21:甘肃","22:四川","24:贵州","25:海南","26:云南","27:青海","28:陕西","29:广西","30:西藏","31:宁夏","32:新疆","33:内蒙古","34:澳门","35:香港","36:海外"]);
add(1,["1:北京"]);
add(2,["2:天津"]);
add(3,["3:上海"]);
add(4,["4:重庆"]);
add(5,["5:石家庄","6:唐山","7:秦皇岛","8:邯郸","9:邢台","10:保定","11:张家口","12:承德","13:沧州","14:廊坊","15:衡水"]);
add(6,["16:太原","17:大同","18:阳泉","19:长治","20:晋城","21:朔州","22:晋中","23:运城","24:忻州","25:临汾","26:吕梁"]);
add(7,["27:台北","28:高雄","29:基隆","30:台中","31:台南","32:新竹","33:嘉义","34:台北","35:宜兰","36:桃园","37:新竹","38:苗栗","39:台中","40:彰化","41:南投","42:云林","43:嘉义","44:台南","45:高雄","46:屏东","47:澎湖","48:台东","49:花莲"]);
add(8,["50:沈阳","51:大连","52:鞍山","53:抚顺","54:本溪","55:丹东","56:锦州","57:营口","58:阜新","59:辽阳","60:盘锦","61:铁岭","62:朝阳","63:葫芦岛"]);
add(9,["64:长春","65:吉林","66:四平","67:辽源","68:通化","69:白山","70:松原","71:白城","72:延边"]);
add(10,["73:哈尔滨","74:齐齐哈尔","75:鹤岗","76:双鸭山","77:鸡西","78:大庆","79:伊春","80:牡丹江","81:佳木斯","82:七台河","83:黑河","84:绥化","85:大兴安岭"]);
add(11,["86:南京","87:无锡","88:徐州","89:常州","90:苏州","91:南通","92:连云港","93:淮安","94:盐城","95:扬州","96:镇江","97:泰州","98:宿迁"]);
add(12,["99:杭州","100:宁波","101:温州","102:嘉兴","103:湖州","104:绍兴","105:金华","106:衢州","107:舟山","108:台州","109:丽水"]);
add(13,["110:合肥","111:芜湖","112:蚌埠","113:淮南","114:马鞍山","115:淮北","116:铜陵","117:安庆","118:黄山","119:滁州","120:阜阳","121:宿州","122:巢湖","123:六安","124:亳州","125:池州","126:宣城"]);
add(14,["127:福州","128:厦门","129:莆田","130:三明","131:泉州","132:漳州","133:南平","134:龙岩","135:宁德"]);
add(15,["136:南昌","137:景德镇","138:萍乡","139:九江","140:新余","141:鹰潭","142:赣州","143:吉安","144:宜春","145:抚州","146:上饶"]);
add(16,["147:济南","148:青岛","149:淄博","150:枣庄","151:东营","152:烟台","153:潍坊","154:济宁","155:泰安","156:威海","157:日照","158:莱芜","159:临沂","160:德州","161:聊城","162:滨州","163:菏泽"]);
add(17,["164:郑州","165:开封","166:洛阳","167:平顶山","168:安阳","169:鹤壁","170:新乡","171:焦作","172:濮阳","173:许昌","174:漯河","175:三门峡","176:南阳","177:商丘","178:信阳","179:周口","180:驻马店","181:济源"]);
add(18,["182:武汉","183:黄石","184:十堰","185:荆州","186:宜昌","187:襄樊","188:鄂州","189:荆门","190:孝感","191:黄冈","192:咸宁","193:随州","194:仙桃","195:天门","196:潜江","197:神农架","198:恩施"]);
add(19,["199:长沙","200:株洲","201:湘潭","202:衡阳","203:邵阳","204:岳阳","205:常德","206:张家界","207:益阳","208:郴州","209:永州","210:怀化","211:娄底","212:湘西"]);
add(20,["213:广州","214:深圳","215:珠海","216:汕头","217:韶关","218:佛山","219:江门","220:湛江","221:茂名","222:肇庆","223:惠州","224:梅州","225:汕尾","226:河源","227:阳江","228:清远","229:东莞","230:中山","231:潮州","232:揭阳","233:云浮"]);
add(21,["234:兰州","235:金昌","236:白银","237:天水","238:嘉峪关","239:武威","240:张掖","241:平凉","242:酒泉","243:庆阳","244:定西","245:陇南","246:临夏","247:甘南"]);
add(22,["248:成都","249:自贡","250:攀枝花","251:泸州","252:德阳","253:绵阳","254:广元","255:遂宁","256:内江","257:乐山","258:南充","259:眉山","260:宜宾","261:广安","262:达州","263:雅安","264:巴中","265:资阳","266:阿坝","267:甘孜","268:凉山"]);
add(24,["269:贵阳","270:六盘水","271:遵义","272:安顺","273:铜仁","274:毕节","275:黔西南","276:黔东南","277:黔南"]);
add(25,["278:海口","279:三亚","280:五指山","281:琼海","282:儋州","283:文昌","284:万宁","285:东方","286:澄迈","287:定安","288:屯昌","289:临高","290:白沙","291:昌江","292:乐东","293:陵水","294:保亭","295:琼中"]);
add(26,["296:昆明","297:曲靖","298:玉溪","299:保山","300:昭通","301:丽江","302:思茅","303:临沧","304:文山","305:红河","306:西双版纳","307:楚雄","308:大理","309:德宏","310:怒江","311:迪庆"]);
add(27,["312:西宁","313:海东","314:海北","315:黄南","316:海南","317:果洛","318:玉树","319:海西"]);
add(28,["320:西安","321:铜川","322:宝鸡","323:咸阳","324:渭南","325:延安","326:汉中","327:榆林","328:安康","329:商洛"]);
add(29,["330:南宁","331:柳州","332:桂林","333:北海","334:防城港","335:钦州","336:贵港","337:玉林","338:百色","339:贺州","340:河池","341:来宾","342:崇左","400:梧州"]);
add(30,["343:拉萨","344:那曲","345:昌都","346:山南","347:日喀则","348:阿里","349:林芝"]);
add(31,["350:银川","351:石嘴山","352:吴忠","353:固原","354:中卫"]);
add(32,["355:乌鲁木齐","356:克拉玛依","357:石河子　","358:阿拉尔","359:图木舒克","360:五家渠","361:吐鲁番","362:阿克苏","363:喀什","364:哈密","365:和田","366:阿图什","367:库尔勒","368:昌吉　","369:阜康","370:米泉","371:博乐","372:伊宁","373:奎屯","374:塔城","375:乌苏","376:阿勒泰"]);
add(33,["377:呼和浩特","378:包头","379:乌海","380:赤峰","381:通辽","382:鄂尔多斯","383:呼伦贝尔","384:巴彦淖尔","385:乌兰察布","386:锡林郭勒盟","387:兴安盟","388:阿拉善盟"]);
add(34,["389:澳门"]);
add(35,["390:香港"]);
add(36,["391:海外"]);
var selpoc=$("<option value=-1>省份</option>");
var selcty=$("<option value=-1>城市</option>");
function initProvinceCity(provinceSel,citySel){
        provinceSel.append(selpoc.clone());
        provinceSel.append(createOptions(Items[0]));            
        provinceSel.change(function(){            
            if($(this).val()==-1)
                citySel.html(selcty.clone().html());
            else
            {
                citySel.html("").append(selcty.clone());
                citySel.append(createOptions(Items[$(this).val()]));
            }
        });
        citySel.append(selcty.clone());
}
function createOptions(cs)
{    
    var options="";
    var len = cs.length;
    for(var i=0;i<len;i++)
    {
        var temp="<option value=";
        temp+=cs[i].split(":")[0]+">"+cs[i].split(":")[1]+"</option>";
        options+=temp;
    }    
    return $(options);    
}
function getProvinceCity(p_c)
{
    var pid=parseInt(p_c.split("_")[0]);
    var cid=parseInt(p_c.split("_")[1]);
    var pv=Items[0][pid].split(":")[1];
    var cv=Items[pid][cid].split(":")[1];
    return pv+"_"+cv;
}

